package _220326;

import java.util.Scanner;

/**
 * @author ShadowLim
 * @create 2022-03-26-12:25
 */
public class 乘积最大VIP {

    /**
     * dp[i][j]表示用i个乘号，对前j个数进行操作能得到的最大值；
     * sum[i][j]表示第i个数到第j个数构成的十进制数的值；
     * 转移方程：dp[i][j] = max(dp[i][j], dp[i-1][k-1]*sum[k][j])，其中k是在枚举乘号的位置，k = i+1 ~ j
     * 初始条件：dp[0][i] = sum[1][i], dp[1][1] = 1
     *
     * @param args
     */

    static int n, k;
    static int[][] sum;
    static int[][] dp;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();
        k = scanner.nextInt();
        String[] s = scanner.next().split("");
        sum = new int[n + 1][n + 1];
        dp = new int[n + 1][n + 1];

        for (int i = 1; i <= n; i++) {
            for (int j = i; j <= n; j++) {
                sum[i][j] = sum[i][j-1]*10 + Integer.parseInt(s[j - 1]);
            }
        }

        for (int i = 1; i <= n; i++) {
            dp[0][i] = sum[1][i];
        }
        dp[1][1] = 1;
        for (int i = 1; i <= k; i++) {
            for (int j = i + 1; j <= n; j++) {
                for (int t = i + 1; t <= j; t++) {
                    dp[i][j] = Math.max(dp[i][j], dp[i - 1][t - 1] * sum[t][j]);
                }
            }
        }
        System.out.println(dp[k][n]);
    }
}
